;;;Place pvmt edge blocks on 'right' side of polyline beginning at nearest end.
;;;Requires blocks PE and PEO (Pvmt Edge and Pvmt Edge Other side).
;;;
;;;	Author:
;;;		Henry C. Francis
;;;		425 N. Ashe St.
;;;		Southern Pines, NC 28387
;;;
;;;	http://paracadd.com
;;;	All rights reserved.
;;;
(defun c:mpe ()
  (if dimscl nil (load"dimscl"))
  (dimscl)
  (command ".undo" "begin")
  (setq meablk (ukword 1 "PE PEO EOG EOGO" "Block to use for EOP Symbol [PE/PEO/EOG/EOGO]" meablk))
  (if (tblsearch "block" meablk)
    nil
    (COMMAND nil nil nil ".-insert" meablk nil nil nil)
  )
  (setq symbol_spacing (ureal 1 "" "Spacing between EOP symbols" symbol_spacing))
  (setq ment (entsel "\nSelect object to measure: "))
;;;  (cond
;;;    ((eq (cdr(assoc 0(entget(car ment))))"LINE")
;;;        (if (>(distance(cadr ment)(cdr(assoc 10(entget(car ment)))))
;;;              (distance(cadr ment)(cdr(assoc 11(entget(car ment))))))
;;;          (setq meablk "pe")
;;;          (setq meablk "peo")
;;;        )
;;;      )
;;;    ((eq (cdr(assoc 0(entget(car ment))))"POLYLINE")
;;;        (setq enext (entnext(car ment)))
;;;        (while (not(eq(cdr(assoc 0(entget enext)))"SEQEND"))
;;;          (setq lastent enext
;;;                enext (entnext enext))
;;;        )
;;;        (if (>(distance(cadr ment)(cdr(assoc 10(entget(entnext(cdr(assoc -2(entget enext))))))))
;;;              (distance(cadr ment)(cdr(assoc 10(entget lastent)))))
;;;          (setq meablk "pe")
;;;          (setq meablk "peo")
;;;        )
;;;      )
;;;  )
  (command ".measure" (cadr ment) "b" meablk "y" symbol_spacing)
  (command ".undo" "end")
  (princ)
)